package com.hdjd.service;

import com.hdjd.entities.Account;
import com.hdjd.entities.FundRecord;
import com.hdjd.entities.Opinion;
import com.hdjd.entities.ReceiveAddress;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface AccountService {
    /**
     * 根据用户名或者学号和密码查询用户信息
     * @param stuNo
     * @param accPwd
     *  @param accName
     * @return
     */
    Object selectAccountByStuNoOrAccNameAndAccPwd(String stuNo,String accName, String accPwd);

    /**
     * 根据用户名ID更新账户的配送员标识
     * @param accId
     * @return
     */
    boolean registerDeliverymanByAccId(Integer accId);

    /**
     * 根据账户Id和密码取钱
     * @param accId
     * @param accPwd
     * @param money
     * @return
     */
    boolean withdrawByAccIdAndAccPwd(Integer accId, String accPwd,double money);

    /**
     * 充值服务
     * @param accId
     * @param money
     * @return
     */
    boolean toUPByAccIdAndAccPwd(Integer accId, double money);

    /**
     * 查询账户余额
     * @param accId
     * @return
     */
    String selectAccBalanceByAccId(Integer accId);

    /**
     * 查账户资金流水
     * @param accId
     * @return
     */
    List<FundRecord> selectFundRecordByAccId(Integer accId, String startDate, String endDate,Integer pageCurrent,Integer pageSize);

    /**
     * 查询账户信息
     * @param accId
     * @return
     */
    Account selectAccountByAccId(Integer accId);

    /**
     * 根据账户对象修改账户信息
     * @param accId
     * @param accImg
     * @param accTruename
     * @param accSex
     * @param accTelephone
     * @param accEmail
     * @param accBirthday
     * @param request
     * @return
     */
    int editAccountByAccount(Integer accId, MultipartFile accImg, String accTruename, Integer accSex, String accTelephone, String accEmail, String accBirthday, HttpServletRequest request);

    /**
     * 查询账户的所有收获地址
     * @param accId
     * @return
     */
    List<ReceiveAddress> selectReceiveAddressByAccId(Integer accId);

    /**
     * 查询账户的默认收获地址
     * @param accId
     * @return
     */
    ReceiveAddress selectDefaultReceiveAddressByAccId(Integer accId);

    /**
     * 查询账户的收获地址
     * @param reAddressId
     * @return
     */
    ReceiveAddress selectReceiveAddressByReAddressId(Integer reAddressId);

    /**
     * 商品评价
     * @param opiId
     * @param detId
     * @param goId
     * @param goNm
     * @param accId
     * @param opiType
     * @param opiContent
     * @return
     */
    int opinionGoods(Integer opiId, Integer detId,Integer goId,String goNm,Integer accId,String opiType,String opiContent,HttpServletRequest request);

    /**
     * 查询我的评价
     * @param accId
     * @return
     */
    List<Map<String,Object>> selectMyOpinion(Integer accId, Integer pageCurrent, Integer pageSize);

    /**
     * 查询我的评价
     * @param accId
     * @return
     */
    int selectMyOpinionNum(Integer accId);

    /**
     * 根据订单Id查询评价信息
     * @param detId
     * @return
     */
    Opinion selectMyOpinionByDetId(Integer detId);

    /**
     * 删除我的评价
     * @param opiId
     * @return
     */
    int deleteMyOpinion(Integer opiId);

    /**
     * 查询资金记录总数
     * @param accId
     * @param startDate
     * @param endDate
     * @return
     */
    Integer selectCountFundRecordByAccId(Integer accId,String startDate,String endDate);

    /**
     * 修改收获地址信息
     * @param receiveAddress
     * @return
     */
    int updateMyReAddress(ReceiveAddress receiveAddress);

    /**
     * 删除收获地址
     * @param reAddressId
     * @return
     */
    int deleteMyReAddress(Integer reAddressId);

    /**
     * 更新为默认收获地址
     * @param accId
     * @param reAddressId
     * @return
     */
    int updateMyReAddressDefault(Integer accId, Integer reAddressId);

    /**
     * 新增收获地址
     * @param receiveAddress
     * @return
     */
    int addMyReAddress(ReceiveAddress receiveAddress);

    /**
     * 用户注册，新增用户
     * @param account
     * @return
     */
    boolean insertAccount(Account account);

    /**
     * 根据用户名查询用户
     * @param accName
     * @return
     */
    boolean selectAccountByAccName(String accName);

    /**
     * 根据评价Id查评价文件
     * @param opiId
     * @return
     */
    List<String> selectOpinionFile(Integer opiId);
}
